﻿using AttributeRouting.Web.Http;
//using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    public class BridgePipeLedgerController : ApiController
    {

        private BridgePipeLedgerQuery Bplq;
        private BridgePipeLedger bpl;

        [POST("GetBridgePipeLedgers")]
        public IList<BridgePipeLedgerQuery> PostGetBridgePipeLedgers(BridgePipeCondition dpc)
        {
            Bplq = new BridgePipeLedgerQuery();
            return Bplq.GetBridgePipeLedgers(dpc);
        }
        /*
        [POST("GetBridgePipeLedgersCount")]
        public int PostGetBridgePipeLedgersCount(BridgePipeLedger info)
        {
            var where = BridgePipeLedgerWhere(info);
            int count = rep.LoadCount(where);
            return count;
        }
        */

        [POST("AddBridgePipeLedger")]
        public bool PostAddBridgePipeLedger(BridgePipeLedger info)
        {
            info.MRNO = BuilderMrno.GetMrnoFortbl("Tbt_BridgePipeLedger");
            bpl = new BridgePipeLedger();
            bool result = bpl.AddBridgePipeLedger(info) > 0 ? true : false;
            return result;
        }

        /*
        [POST("EditBridgePipeLedger")]
        public bool PostEditBridgePipeLedger(BridgePipeLedger info)
        {
            bool result = rep.Edit(info);
            return result;
        }

        [GET("DeleteBridgePipeLedger/{code}")]
        public bool GetDeleteBridgePipeLedger(string code)
        {
            bool result = rep.Delete(code);
            return result;
        }

        [GET("GetBridgePipeLedger/{code}")]
        public BridgePipeLedger GetBridgePipeLedger(string code)
        {
            var result = rep.Get(code);
            return result;
        }
         * */
    }
}
